

//这个下面是vue对象使用

import VueRouter from 'vue-router'

import home from './component/tabbar/home.vue'
import cart from './component/tabbar/cart.vue'
import member from './component/tabbar/member.vue'
import search from './component/tabbar/search.vue'
import news from './component/news/newsList.vue'
import newsInfo from './component/news/newsInfo.vue'

//3创建一个路由对象
var router = new VueRouter({
    routes: [
        {path:'/',redirect:'/home'},//这里是设置根目录
        {path:'/home',component: home},
        {path:'/cart',component: cart},
        {path:'/member',component: member},
        {path:'/search',component: search},
        {path:'/home/newsList',component:news},
        {path:'/home/newsInfo/:id',component:newsInfo}
    ],
    linkActiveClass:'mui-active'//覆盖路由高亮的类，默认的类是router-link-active
})

export default router